/**
 *Syslib alpha effects class
 * @version 0.1
 */
syslib.ui.fx.Alpha = {
	show : function(element, currentAlpha){
		// get the current alpha
		if(!__valid(currentAlpha)){
			currentAlpha = 0;
		}
		
		// calcule the alpha
		var alpha = currentAlpha + ((100 - currentAlpha) / 8);
		
		if(alpha == currentAlpha){
			// move the element to the final position
			syslib.element.updateStyle(element, {
				"filter" : "alpha(opacity=100)", 
				"mozOpacity" : "1", 
				"khtmlOpacity" : "1", 
				"opacity" : "1"
			});
		} else {
			// move the element
			syslib.element.updateStyle(element, {
				"filter" : "alpha(opacity="+alpha+")", 
				"mozOpacity" : (alpha / 100), 
				"khtmlOpacity" : (alpha / 100), 
				"opacity" : (alpha / 100)
			});
			
			// set the interval
			setTimeout(function(){
				syslib.ui.fx.Alpha.show(element, alpha);
			}, 20);
		}
	}, 
	
	hide : function(element, currentAlpha){
		// get the current alpha
		if(!__valid(currentAlpha)){
			currentAlpha = 100;
		}
		
		// calcule the alpha
		var alpha = currentAlpha + ((0 - currentAlpha) / 8);
		
		if(alpha == currentAlpha){
			// move the element to the final position
			syslib.element.updateStyle(element, {
				"filter" : "alpha(opacity=0)", 
				"mozOpacity" : "0", 
				"khtmlOpacity" : "0", 
				"opacity" : "0"
			});
		} else {
			// move the element
			syslib.element.updateStyle(element, {
				"filter" : "alpha(opacity="+alpha+")", 
				"mozOpacity" : (alpha / 100), 
				"khtmlOpacity" : (alpha / 100), 
				"opacity" : (alpha / 100)
			});
			
			// set the interval
			setTimeout(function(){
				syslib.ui.fx.Alpha.hide(element, alpha);
			}, 20);
		}
	} 
};